function varitest(time,y,a,m,b,yic,Y,casenum)

load('orthbase');

switch casenum
    case 1
        exactvar=3*time.^2;
    case 2
        exactvar=1/2*time.^2;
    case 3
        exactvar=3*time.^2;
        load('case3');
        %exactvar=mcpart;
    case 4
        load('case4');
        exactvar=a^2*m^2*mcpart;
    case 5
        %load('case5_`')
        load('case5')
        exactvar=mcpart;
end

hold on
tmp=zeros(size(y(:,1)));
for ii=1:size(Y,2)
    %tmp=tmp+Y(:,ii).*Y(:,ii);
    tmp=tmp+Y(:,ii);
end
plot(time,tmp,'r-');
time=linspace(0,0.5,51);
plot(time,exactvar);
title('Variance')
legend('wce var','exact var');